﻿/**
 * 
 * @file MaterialElasticWidget.h
 * @brief 弹性材料界面声明
 * @author BaGuijun (baguijun@163.com)
 * @date 2024-04-22
 * 
 */
#ifndef MaterialElasticWidget_H
#define MaterialElasticWidget_H

#include "MaterialWidgetBase.h"
#include "FITK_Interface/FITKInterfaceStructural/FITKAbaMaterialBehavior.h"

namespace Ui
{
    class MaterialElasticWidget;
}

namespace Interface
{
    class FITKAbaMaterialElastic;
}

namespace GUI
{
    /**
     * @brief 弹性材料接口声明
     * @author BaGuijun (baguijun@163.com)
     * @date 2024-04-22
     */
    class MaterialElasticWidget : public MaterialWidgetBase
    {
        Q_OBJECT;
    public:
        /**
         * @brief Construct a new Mat Item Elastic Form object
         * @param[i]  item           My Param doc
         * @param[i]  parent         My Param doc
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-04-22
         */
        explicit MaterialElasticWidget(EventOper::ParaWidgetInterfaceOperator * oper,Interface::FITKAbaMaterialElastic* item, QWidget* parent = nullptr );
        /**
         * @brief Destroy the Mat Item Elastic Form object
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-04-22
         */
        ~MaterialElasticWidget( );
        /**
         * @brief 显示数据
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void showValue();
        /**
         * @brief 数据检查
         * @return true 成功
         * @return false 失败
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-12
         */
        bool checkValue() override;
        /**
         * @brief 存储数据
         * @return true 成功
         * @return false 失败
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-12
         */
        bool saveValue() override;
    private slots:
        ;
        /**
         * @brief 弹性材料类型选择事件
         * @param[i]  index          材料类型索引值
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void on_comboBoxState_activated(int index);
        /**
         * @brief 材料温度选择事件
         * @param[i]  checked        是否点击
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void on_checkBox_temp_clicked(bool checked);
    private:
        /**
         * @brief 初始化TableWidget
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void initTable();
        /**
         * @brief 显示子模块数据
         * @param[i]  type           子模块类型
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void showValue(Interface::FITKAbaMaterialBehaviorEnum::FITKAbaMaterialElasticType type);
        /**
         * @brief 存储子模块数据
         * @param[i]  type           子模块类型
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void saveValue(Interface::FITKAbaMaterialBehaviorEnum::FITKAbaMaterialElasticType type);
        /**
         * @brief 根据类型修改弹性材材料界面参数
         * @param[i]  type           材料类型
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void changeMaterialElasticType(Interface::FITKAbaMaterialBehaviorEnum::FITKAbaMaterialElasticType type);
        /**
         * @brief 根据弹性材料类型及是否使用温度修改与温度相关界面参数
         * @param[i]  type           材料类型
         * @param[i]  isTemp         是否使用温度
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void changeMaterialTemp(Interface::FITKAbaMaterialBehaviorEnum::FITKAbaMaterialElasticType type, bool isTemp);
    private:
        /**
         * @brief ui对象
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-04-22
         */
        Ui::MaterialElasticWidget*      _ui = nullptr;
        /**
         * @brief 弹性材料对象
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-04-22
         */
        Interface::FITKAbaMaterialElastic* _elasticItem = nullptr;
    };
}  // namespace GUI

#endif  // MaterialElasticWidget_H
